dialogbox 'C="Continue"' '"Welcome to the ARexx demo and AddressAssist (AA) Tutorial!!!\n\nThis short tutorial should give you an overlook over AA s basics\nand serves as a guide for ARexx users."'
dialogbox 'C="Yes, please|No"' '"Dialogboxes like this may be created using the DIALOGBOX command\nat every place in an ARexx script.\n\nWould you like to start the demo ???"'
if result = 1 then do
setview Listview
dialogbox 'ControlString="OK"' 'First, lets clear the current database and\ncreate a new one with name *DemoDatabase*!'
newdatabase "DemoDatabase"
dialogbox 'ControlString="Yeh"' 'Now, add some records!'
newrecord 'Schneider'
setrecorddata name2 'Alex H.'
setrecorddata address1 'Kruggasse 179'
setrecorddata address2 'Quarz Development'
setrecorddata place 'CH-5462 Siglistorf'
setrecorddata phone1 '++41 56 243 18 33'
setrecorddata free1 'schneider@igt.baum.ethz.ch'
setrecorddata free2 '1'
setrecorddata remark1 'This guy is the maker of AddressAssist!!!'
setrecordgroups G1 G9 G10
newrecord 'Schneider'
setrecorddata name2 'Ramona'
setrecorddata address1 'Kruggasse 179'
setrecorddata place 'CH-5462 Siglistorf'
setrecorddata phone1 '++41 56 243 18 33'
setrecorddata free2 '2'
setrecorddata remark1 'This is my daughter, she is seven years old!!!'
setrecorddata remark1 'Without this guy, AA s nice GUI would not have been possible as easy as it was: This is the creator of MUI: the *only* GUI creation library, which deserves this name!'
setrecordgroups G1 G9 G10
newrecord 'Thomas'
setrecorddata name2 'Mark'
setrecorddata address1 '1515 Royal Crest Dr. #3259'
setrecorddata place 'Austin, TX 78741'
setrecorddata free1 'mthomas@zilker.net'
setrecorddata free2 '3'
setrecorddata remark1 'Author of textfield.gadget'
setrecordgroups G2 G9 G10
newrecord 'Potter'
setrecorddata name2 'Jonathan'
setrecorddata address1 'GPSoftware'
setrecorddata place 'Brisbane, Australia'
setrecorddata free1 ''
setrecorddata free2 '4'
setrecorddata remark1 'This is the maker of the famous and excellent DOpus5!!'
setrecordgroups G3 G9 G10
newrecord 'Schneider'
setrecorddata name2 'Yolanda'
setrecorddata address1 'Kruggasse 179'
setrecorddata place 'CH-5462 Siglistorf'
setrecorddata phone1 '++41 56 243 18 33'
setrecorddata free2 '2'
setrecorddata remark1 'This is my wife, the best in the world!'
current 0
setview F
dialogbox 'ControlString="I agree"' 'Oh, we have to rename the *FreeX* fields to *e-mail* and *ID-Number*!'
setfreename F1 'e-mail:'
setfreename F2 'ID-No.:'
dialogbox 'ControlString="If you want"' 'And adjust the group names!??'
setgroupname G1 'European'
setgroupname G2 'American'
setgroupname G3 'Australia'
setgroupname G8 'PC Developer'
setgroupname G9 'Amiga User'
setgroupname G10 'Amiga Developer'
dialogbox 'ControlString="Yala guuut"' 'Now open the Remark1 window'
remark1window Open
dialogbox 'ControlString="Wow"' 'Ok, now select all Amiga developers and exclude all non-Europeans.'
setview Listview
selectgroup G10
selectgroup X G2 G3
dialogbox 'ControlString="Why ???"' 'Export selected records as ASCII file\nusing *Prefs/Default.xpref* ....'
dialogbox 'ControlString="Really??"' 'Unselect all records and view only *Group5*.'
selectnone
setlistview G5
dialogbox 'ControlString="Really??"' 'Select *Group5* records, remove the selected records\nand view all other records.'
selectgroup G5
removeselection
setlistview all
dialogbox 'ControlString="Yep!|Noop!"' 'This was the first part.\n\nThere are more interesting items to see in the demo.\nWould you like to continue ?'
if result = 1 then do
dialogbox 'C="Yuhuh"' 'Ok, then let us select all people from *Siglistorf*\nand save them into a separate database called *The_Schneider_Family*.'
selectstring '*Siglistorf*'
exportselection D '"The Schneider Family"'
dialogbox 'C="Yuhuh"' 'Uff, now import *The_Schneider_Family* again.\nWatch: the group information will stay intact, because we exported as an AA database.\n\nFinally, sort the database twice:\n 1st with index *Name2* and\n 2nd by *Name*'
importselection '"The Schneider Family"'
selectnone
sort name2
sort name
dialogbox 'C="Wow"' 'Ok, now lets remove all identical records using 1 single function call.'
removeduplicaterecords
dialogbox 'ControlString="Yes please!|I am sorry!"' 'You survived part 2 of this demo!\n\nBut, this is still not all.Would you like to continue ?'
if result = 1 then do
dialogbox 'C="OK"' 'Now we are taking a look at the record data of *Alex Schneider*.\nFirst, find his record and set it as the current one.'
find 'Alex'
dialogbox 'C="Interesting"' 'There are two ways to read record data in ARexx:\n . use GETRECORDDATA to read a record field s data\n . use FORMATRECORDSTRING for C-like (sprintf) formatting of record data.'
getrecorddata name
strName = result
getrecorddata name2
strName2 = result
getrecorddata address1
strAddr1 = result
getrecorddata place
strPlace = result
say 'Current record data (by repeated use of GETRECORDDATA):'
say 'Name....: 'strName
say 'Name2...: 'strName2
say 'Address.: 'strAddr1
say 'Place...: 'strPlace
formatrecordstring '%f2 %f1\nliving at %f3 in %f5.\ne-mail is %f8'
dialogbox 'C="Wow!!!"' 'Current record data (by use of formatrecordstring)\n\n'result
/* dialogbox 'C="Yes, of course|No thanks. That is enough!"' 'Finally, would you like to print the database ???'
dialogbox 'ControlString="Yes, please!|Noooo!"' 'Ok, this is all for now!\n\nHope you enjoyed this demo and got an overview over some of AA s features.\n\nThe last question: would you like to save this database to disk!??'
if result = 1 then
savedatabase /** database is saved with default name: 'testDatabase' from newdatabase */